import businessRoutes from "../../router/businessRoutes";
const getDefaultState = () => {
  return {
    menudata: businessRoutes,
    pagePermissions: [],
    validRoutes: []
  };
};
export default {
  state: getDefaultState(),
  mutations: {
    RESETLOCALSTATE(state) {
      state = Object.assign(state, getDefaultState());
    },
    SETMENUDATA(state, data) {
      state.menudata = data;
    },
    SETPAGEPERMISSIONS(state, data) {
      state.pagePermissions = data;
    },
    SETVALIDROUTES(state, data) {
      state.validRoutes = data;
    }
  },
  actions: {
    setMenuData({ commit }, data) {
      commit("SETMENUDATA", data);
    },
    setPagePermissions({ commit }, data) {
      commit("SETPAGEPERMISSIONS", data);
    },
    setValidRoutes({ commit }, data) {
      commit("SETVALIDROUTES", data);
    }
  }
};
